📐 ConstructQ · WBS Template Management — ER Diagram v13.0

6 ตาราง · 6 ความสัมพันธ์ · อ้างอิงไฟล์ ConstructQ_WBSTemplate_v13.0.html
🔑 Primary Key
🔗 Foreign Key
Master
Rows
Version
Audit
Lookup
Tags
Master
Detail / Rows
Version / Audit
Lookup / Tags
wbs_templatesMaster
idBIGSERIAL
codeVARCHAR(40) UQ
name_thVARCHAR(200)
name_enVARCHAR(200)
desc_thTEXT
desc_enTEXT
iconVARCHAR(20)
versionVARCHAR(10)
tagsVARCHAR(300)
default_ref_std→ ref_standards
statusVARCHAR(20)
is_activeBOOLEAN
organization_id→ organizations
created_by→ users
15 cols
wbs_template_rowsL1/L2/L3
idBIGSERIAL
template_id→ wbs_templates
levelCHAR(2)
codeVARCHAR(20)
parent_codeVARCHAR(20)
nameVARCHAR(300)
ref_std→ ref_standards
riskCHAR(1)
hw_statusVARCHAR(10)
checklistVARCHAR(200)
criteriaTEXT
sort_orderINT
≈500 rows total · 8 templates
wbs_template_versionsSnapshot
idBIGSERIAL
template_id→ wbs_templates
versionVARCHAR(10)
snapshotJSONB
notesTEXT
published_by→ users
published_atTIMESTAMPTZ
wbs_template_auditTrail
idBIGSERIAL
template_id→ wbs_templates
actor_id→ users
actor_nameVARCHAR(200)
actor_roleVARCHAR(30)
actionVARCHAR(40)
fieldVARCHAR(40)
change_summaryTEXT
diffJSONB
created / edited / duplicated / published / inline_edit
ref_standards22 rows
idBIGSERIAL
codeVARCHAR(50) UQ
label_enVARCHAR(200)
label_thVARCHAR(200)
categoryVARCHAR(40)
sort_orderINT
is_activeBOOLEAN
Concrete · Steel · Piping · Test · Codes · Systems · Thai
wbs_template_tagsM:N
idBIGSERIAL
template_id→ wbs_templates
tagVARCHAR(40)
Auto-recommend by project type

🔗 ความสัมพันธ์ระหว่างตาราง · Relationships

wbs_templates─1:N→wbs_template_rows(1 template · N rows L1/L2/L3)
wbs_templates─1:N→wbs_template_versions(snapshot history)
wbs_templates─1:N→wbs_template_audit(activity log)
wbs_templates─1:N→wbs_template_tags(project type mapping)
wbs_templates─N:1→ref_standards(default_ref_std for new rows)
wbs_template_rows─N:1→ref_standards(each row's ref_std)

📊 ตัวอย่างข้อมูล · Sample Data

wbs_templates (8 standard templates)

idcodename_thversionstatusicon
1condoคอนโด / High-rise1.1published🏢
2officeอาคารสำนักงาน1.1published🏬
3lowriseอาคารพักอาศัย Low-rise1.0published🏘️
4mixedMixed-use Complex1.0published🏙️
5factoryโรงงานอุตสาหกรรม1.0published🏭
6datacenterดาต้าเซ็นเตอร์1.0published💾
7civilโครงสร้างพื้นฐาน1.0published🛣️
8hospitalโรงพยาบาล1.0published🏥

wbs_template_rows (condo template · 9 of 76 rows)

templatelevelcodeparentnameref_stdriskhw
1L11งานโครงสร้าง RC
1L21.11งานเสาเข็ม / ฐานรากACI 336H
1L31.1.11.1กำหนดตำแหน่งและทดสอบดินACI 336H
1L31.1.21.1ตอก / เจาะเสาเข็มACI 336HWITNESS
1L31.1.31.1Pile Integrity Test (PIT)ASTM D5882HHOLD
1L31.1.41.1ผูกเหล็กและตรวจเหล็ก Pile CapACI 318HWITNESS
1L21.21โครงสร้างเหนือดินACI 318H
1L31.2.11.2ผูกเหล็กเสริมACI 318H
1L31.2.21.2ติดตั้ง FormworkACI 347H

wbs_template_versions (condo history · snapshot pattern)

idtemplateversionpublished_bynotes
111.0สมชาย ใจดีInitial release · 4 disciplines · 15 packages · 57 activities
211.1วุธ ศิริกุลเพิ่ม Pile Integrity Test (ASTM D5882) + Risk Level ปรับเป็น H

wbs_template_audit (recent 5 actions)

idactoractionchange_summarydate
1วุธ ศิริกุลinline_editInline edit ชื่อ · 'คอนโด / High-rise' → 'Condo High-rise Premium'23 มิ.ย. 14:30
2วุธ ศิริกุลeditedแก้ไข Risk Level ที่ 1.1.3 จาก M → H23 มิ.ย. 14:20
3วุธ ศิริกุลpublishedเผยแพร่ v1.123 มิ.ย. 14:35
4สมชาย ใจดีduplicatedทำซ้ำจาก office เป็น 'office-copy'20 มิ.ย. 10:00
5วุธ ศิริกุลcreatedสร้างเทมเพลตครั้งแรก15 พ.ค. 09:00

ref_standards (22 standards · 8 categories · sample 9 rows)

idcodelabel_encategorysort
1ACI 318ACI 318 · Concrete Building CodeConcrete1
2ACI 336ACI 336 · PilesConcrete2
3ACI 347ACI 347 · FormworkConcrete3
7AISC 360AISC 360 · Steel ConstructionSteel1
9AWS D1.1AWS D1.1 · Structural WeldingSteel3
11ASME B31.1ASME B31.1 · Power PipingPiping1
13ASTMASTM · GenericTest1
14ASTM D5882ASTM D5882 · Pile IntegrityTest2
21TISมอก. / TIS · Thai IndustrialThai1